package com.zwj.batch.core.batch.step.tasklet;

import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.stereotype.Component;

/**
 * @author 张文接
 * @version 1.0
 * @createTime 2024/1/7 22:38
 */
@Slf4j
@Component
public class UserTasklet {
    /**
     * 学习batchJob用法
     *
     * @return Tasklet
     */
    public Tasklet batchJobStudyTasklet() {
        return new Tasklet() {
            @Override
            public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {
                log.info("===========学习batchJob用法Tasklet  start");
                return RepeatStatus.FINISHED;
            }
        };
    }
}
